package com.robert.service.impl;

import com.robert.entity.BlogEntity;
import com.robert.mapper.BlogMapper;
import com.robert.service.BlogService;
import com.robert.util.Pager;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *
 * </p>
 *
 * @author robert zhao
 * @since 2020/5/6
 */
@Service
public class BlogServiceImpl implements BlogService {

  @Autowired
  private BlogMapper blogMapper;

  @Override
  public List<BlogEntity> getBlogList(Pager pager) {

    Integer totalSize = blogMapper.count();
    pager.setTotal(totalSize);

    return blogMapper.selectList(pager);
  }
}
